package com.xugui.learn.pay.strategy;

import com.xugui.learn.pay.pojo.enums.PayChannel;
import com.xugui.learn.pay.pojo.request.NotifyRequest;
import com.xugui.learn.pay.pojo.request.PayRequest;
import com.xugui.learn.pay.pojo.request.RefundRequest;
import com.xugui.learn.pay.pojo.response.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 支付宝支付实现
 */
@Slf4j
@Component
public class AlipayStrategy extends AbstractPayStrategy {

    @Override
    protected PayResponse doPay(PayRequest request) {
        try {
            // TODO 业务实现
            return null;
        } catch (Exception e) {
            throw new RuntimeException("支付宝支付失败", e);
        }
    }

    @Override
    protected QueryResponse doQueryOrder(PayRequest request) {
        return null;
    }

    @Override
    protected CloseResponse doClose(PayRequest request) {
        return null;
    }

    @Override
    protected RefundResponse doRefund(RefundRequest request) {
        return null;
    }

    @Override
    protected RefundResponse doQueryRefund(RefundRequest request) {
        return null;
    }

    @Override
    public PayChannel getPayChannel() {
        return PayChannel.ALI_PAY;
    }

    @Override
    public NotifyResponse handleNotify(NotifyRequest request) {
        return null;
    }
}